//=============================================================================
// Disruptor
//=============================================================================
class TFDisruptor extends TFWeapon				//LinkGun placeable;
	config(User);

var() int GoopStartAmmo;

/* BestMode()
choose between regular or alt-fire
*/
function byte BestMode()
{

	local vector EnemyDir;
	local float EnemyDist;
	local bot B;

	B = Bot(Instigator.Controller);
	if ( (B == None) || (B.Enemy == None) )
		return 0;

	EnemyDir = B.Enemy.Location - Instigator.Location;
	EnemyDist = VSize(EnemyDir);
	if ( EnemyDist > 2000 || Frand() > 0.75 || Vehicle(B.Enemy) != None)
		return 0;
	else
		return 1;
}


simulated function float ChargeBar()
{
	return FMin((1.0 - ((FireMode[0].NextFireTime-Level.TimeSeconds) / FireMode[0].FireRate)), 0.999);
}

simulated function bool ConsumeAmmo(int Mode, float load, optional bool bAmountNeededIsMax)
{
    if (Ammo[Mode] != None)
        Ammo[Mode].UseAmmo(int(load));
    return true;
}

simulated function bool HasAmmo()
{
    return ( (Ammo[0] != None && FireMode[0] != None && Ammo[0].AmmoAmount >= FireMode[0].AmmoPerFire)
          || (Ammo[1] != None && FireMode[1] != None && Ammo[1].AmmoAmount >= FireMode[1].AmmoPerFire) );
}







//simulated function bool HasAmmo()
//{
//    return ( (Ammo[0].AmmoAmount >= 1) || FireMode[1].bIsFiring );
//}

//simulated function IncrementFlashCount(int mode)
//{
//}

//simulated function bool PutDown()
//{
//    return Super.PutDown();
//}

defaultproperties
{
     FireModeClass(0)=Class'Taskforces.DisruptorFire'
     FireModeClass(1)=Class'Taskforces.DisruptorAltFire'
     IdleAnimRate=0.030000
     SelectSound=Sound'WeaponSounds.LinkGun.SwitchToLinkGun'
     SelectForce="SwitchToLinkGun"
     AIRating=0.780000
     CurrentRating=0.780000
     bShowChargingBar=True
     bNoAmmoInstances=False
     EffectOffset=(X=80.000000,Y=25.000000,Z=-8.000000)
     DisplayFOV=60.000000
     InventoryGroup=7
     GroupOffset=2
     PickupClass=Class'Taskforces.DisruptorPickup'
     PlayerViewOffset=(X=-5.000000,Y=-9.000000,Z=5.000000)
     PlayerViewPivot=(Yaw=500)
     BobDamping=1.575000
     AttachmentClass=Class'Taskforces.DisruptorAttachment'
     IconMaterial=Texture'TFMedia.General.ArkonHUD'
     IconCoords=(X1=179,Y1=122,X2=241,Y2=172)
     ItemName="Disruptor"
     Mesh=SkeletalMesh'Weapons.BioRifle_1st'
     DrawScale=1.400000
     Skins(0)=Combiner'TFMedia.Disruptor.DisruptorCombiner1'
     Skins(1)=Shader'TFMedia.Disruptor.DisruptorGreenShader'
     UV2Texture=Shader'XGameShaders.WeaponShaders.WeaponEnvShader'
     AmmoRegenAmount(0)=5
     SkillCost=100
     StationDmgModifier=0.3
}
